package com.li.spring6.service;

import com.li.spring6.dao.PetDao;
import com.li.spring6.dao.UserDao;

/**
 * bean
 */
public class UserServiceImpl {

    //set注入的话，必须提供一个set方法
    private UserDao userDao;
    private PetDao petDao;

    //符合java bean规范的set方法
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void setPetDao(PetDao petDao) {
        this.petDao = petDao;
    }

    public void saveUser() {
        userDao.insert();
        petDao.insert();
    }

}
